﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Xyz.Web.Reservation.Models.BookingModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Bookings
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Bookings</h2>
    <table>
        <tr>
            <td style="width: 50px;"><b>
            </b></td>
            <td style="width: 100px;"><b>
                Trip Code
            </b></td>
            <td style="width: 100px;"><b>
                Status
            </b></td>
            <td style="width: 100px; text-align: right;"><b>
                Total Ticket Fare
            </b></td>
            <td style="width: 20px;">&nbsp;</td>
            <td style="width: 150px;"><b>
                Payment Due
            </b></td>
            <td style="width: 150px;"><b>
                Booking Date
            </b></td>
        </tr>
        <% int count = 0;
           foreach (var item in Model)
           {
        %>
        <tr class='<% = ++count % 2 == 0 ? "tablerow" : "tablerow-alt" %>'>
            <td>
                <%: Html.ActionLink("Details", "Booking", new { bookingCode = item.BookingCode })%>
            </td>
            <td>
                <%: item.TripCode %>
            </td>
            <td>
                <%: item.Status %>
            </td>
            <td style="text-align: right;">
                <%: String.Format("{0:F}", item.TotalTicketFare) %>
            </td>
            <td style="width: 20px;">&nbsp;</td>
            <td>
                <%: String.Format("{0:g}", item.PaymentDue) %>
            </td>
            <td>
                <%: String.Format("{0:g}", item.BookingDate) %>
            </td>
        </tr>
        <% } %>
    </table>
</asp:Content>
